# -*- coding: utf-8 -*- 
# 作者:飞虎
# 开发时间:2022/4/30 22:59
# 0. 导入需要的包和模块
from PyQt5.Qt import *
import sys

class MyWindow(QWidget):
	# a0: QtGui.QMouseEvent
	def mouseMoveEvent(self,me):
		QMouseEvent
		print('鼠标移动了', me.localPos())

# 1. 创建一个应用程序对象
app = QApplication(sys.argv)
# 2. 控件的操作
# 2.1 创建控件
window = MyWindow()
# 2.2 设置控件
window.setWindowTitle('鼠标操作')
window.resize(500, 500)
window.setMouseTracking(True)

print(window.hasMouseTracking())

# pixmap = QPixmap("xxx.png")
# new_pixmap=pixmap.scaled(30,30)
# cursor = QCursor(new_pixmap,0,0)
# window.setCursor(cursor)
# # window.unsetCursor()
# current_cursor = window.cursor()
# current_cursor.setPos(100,100)
# print(current_cursor.pos())

# window.setCursor(Qt.ForbiddenCursor)
# label = QLabel(window)
# label.setText('社会飞虎哥')
# label.resize(100,100)
# label.setStyleSheet("background-color:cyan;")

# label.setCursor(Qt.ForbiddenCursor)



# window.setCursor(Qt.BusyCursor)



# 2.3 展示控件
window.show()
# 3. 应用程序的执行,进入到消息循环
sys.exit(app.exec_())
